Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add evm query #74

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Add evm query #74

merged 4 commits into from
Apr 9, 2024

Conversation

philipsu522
Copy link
Contributor

No description provided.

- EVM
- Query
- StaticCall
- TODO
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what this does

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is basically the "generic query" endpoint (i.e. query any endpoint on any EVM contract)

- Query
- StaticCall
- TODO
- Erc20TransferPayload
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to confirm these are all "Gets"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah these are just helpers for callers to format payload. Alternatively they can also format payload by themselves by reading ERC20's ABI in rust

- Erc721IsApprovedForAll
- Checks if the caller is approved for all based on caller, contract address, owner and operator
- Erc721SetApprovalAllPayload
- Gets the Erc721 SetApproveAll payload from caller, contract address, owner and operator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct? seems like it's "setting" something

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is correct (there is a function SetApproveAll that approves the operator to operate all tokens one owns)

- Erc721Approved
- Check si a caller is approved based on caller, contract address and token id
- Erc721IsApprovedForAll
- Checks if the caller is approved for all based on caller, contract address, owner and operator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • is this actually verifying the caller is approved or the operator
  • what specific operations does "approved for all" mean? i can add more info here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this checks if the operator is approved to operate (aka transfer on behalf of the owner) all NFTs under the owner

- Erc721ApprovePayload
- Similar to the Erc20 equivalent
- Erc721Approved
- Check si a caller is approved based on caller, contract address and token id
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what operations is the caller approved for here?

- Erc20TransferFromPayload
- Gets the Erc20 transfer from payload based on owner, recipient and amount
- Erc20ApprovePayload
- Gets the Erc20 approve payload from spender and amount
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify this is correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

- Erc20TransferPayload
- Gets the Erc20 transfer payload from on recipient and amount
- Erc20TransferFromPayload
- Gets the Erc20 transfer from payload based on owner, recipient and amount
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify this is correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

- Erc721ApprovePayload
- Similar to the Erc20 equivalent
- Erc721Approved
- Checks if a caller is approved based on caller, contract address and token id
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what operations is the caller approved for here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to send NFTs on behalf of the owner

@philipsu522 philipsu522 merged commit e4b06b7 into main Apr 9, 2024
4 checks passed
@philipsu522 philipsu522 deleted the evm-sei-cw-readme branch April 9, 2024 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants